package practice09;



public class Teacher extends Person{
    private int id;
    private String name;
    private int age;
    private Klass klass;

    public Teacher(int id, String name, int age) {
        super(id, name, age);
    }

    public String introduce(){
        if (klass==null){
            return super.introduce()+" I am a Teacher. I teach No Class.";
        }else {
            return super.introduce()+" I am a Teacher. I teach Class "+klass.getNumber()+".";
        }
    }
    public String introduceWith(Student student){
        if (klass.getNumber()==student.getKlass().getNumber()){
            return super.introduce()+" I am a Teacher. I teach "+student.getName()+".";
        }else {
            return super.introduce()+" I am a Teacher. I don't teach "+student.getName()+".";
        }
    }

    public Teacher(int id, String name, int age, Klass klass) {
        super(id, name, age);
        this.klass = klass;
    }

    @Override
    public int getId() {
        return super.getId();
    }

    @Override
    public String getName() {
        return super.getName();
    }

    @Override
    public int getAge() {
        return super.getAge();
    }

    public Klass getKlass() {
        return klass;
    }
}
